home *** CD-ROM | disk | FTP | other *** search
- Function StrAssign(VAR Dest:PCHAR; Source:PCHAR):PCHAR;
- { Allocate memory and copy existing source to dest. This first
- deallocates dest's memory if required. }
- begin
- if Dest <> NIL then StrDispose(Dest);{ Deallocate Dest }
- if (Source = NIL) OR (Source[0] = #0) then
- Dest := NIL { No source string so return NIL }
- else
- begin
- GetMem(Dest, StrLen(Source)+1 ); { +1 for the 0 byte }
- StrCopy(Dest, Source)
- end
- end;
-
-
-